﻿@model IList<DynamicLinqWebDocs.Models.Example>


@if( Model.Count > 0 )
{
    <h3>Examples</h3>
    <ul class="nav nav-tabs">
        <li class="active"><a href="#csharp" data-toggle="tab">C#</a></li>
        <li class="disabled"><a title="VB examples are not currently supported">VB</a></li>
    </ul>
    
    <div class="tab-content" style="padding:10px">
        <div class="tab-pane fade in active" id="csharp">
            @for( int i = 0; i < Model.Count; i++)
            {
                var example = Model[i];

                @Html.FormatMarkdown(example.HeaderRemarks)

                if (example.EquivalentCode == null)
                {
                    @Html.FormatCodeBlock(example.ExampleCode)
                }
                else
                {
                    <div class="row">
                        <div class="col-md-6">
                            <h5><strong>Dynamic</strong> LINQ Example</h5>
                            @Html.FormatCodeBlock(example.ExampleCode)
                        </div>
                        <div class="col-md-6">
                            <h5><strong>Standard</strong> LINQ Example</h5>
                            @Html.FormatCodeBlock(example.EquivalentCode)
                        </div>
                    </div>
                }

                @Html.FormatMarkdown(example.FooterRemarks)

                if (i < (Model.Count - 1))
                {
                    <br />
                }
            }
        </div>
        <div class="tab-pane fade" id="vb">
            <div class="alert alert-danger">VB examples are not yet supported.</div> 
        </div>
    </div>
}